package com.itheima.dao;

import com.itheima.domain.Student;

import java.io.FileWriter;
import java.io.IOException;

public class addDao {




    public static void saveStudent(Student student)  {
        try {
            FileWriter fileWriter = new FileWriter("D:\\软件\\桌面\\aaa.txt",true);
            fileWriter.write(student.getUsername()+","+student.getAge()+","+student.getId()+"\r\n");
            fileWriter.flush();
            fileWriter.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
